﻿using Shuttle.ESB.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nature.Core.Distributed
{
    public abstract class BaseMessageHandler<Event> : IMessageHandler<Event>
        where Event : class
    {

        protected abstract void Process(EventHandlerContext<Event> context);

        public void ProcessMessage(HandlerContext<Event> context)
        {
            Process(new EventHandlerContext<Event>(context));
        }

        public virtual bool IsReusable
        {
            get { return true; }
        }
    }
}
